package com.supemarket.service.impl;

import java.util.List;

import com.supemarket.dao.AddSupemarketDao;
import com.supemarket.dao.BaseDao;
import com.supemarket.dao.DelSupemarketDao;
import com.supemarket.dao.SelectSupemarketDao;
import com.supemarket.dao.UpdateSupemarket;
import com.supemarket.dao.impl.AddSupemarketDaoimpl;
import com.supemarket.dao.impl.DelSupemarketDaoimpl;
import com.supemarket.dao.impl.SelectSupemarketDaoimpl;
import com.supemarket.dao.impl.UpdateSupemarketimpl;
import com.supemarket.entity.commodity;
import com.supemarket.service.Goodsservice;

public class Goodsserviceimpl extends BaseDao implements Goodsservice{

	
	AddSupemarketDao addDao = new AddSupemarketDaoimpl();
	SelectSupemarketDao seleDao = new SelectSupemarketDaoimpl();
	UpdateSupemarket upDao = new UpdateSupemarketimpl();
	DelSupemarketDao delDao = new DelSupemarketDaoimpl();
	
	@Override
	public boolean commoditieadd(commodity comm) {
		 int i=addDao.commoditieadd(comm);
		 if(i>0)
		 {//添加成功
			 return true;
		 }
		return false;
	}

	@Override
	public List<commodity> comm() {
		//查询全部
		return seleDao.commodities();
	}

	@Override
	public boolean commoditieup(commodity commodity) {
		int i=upDao.commoditieup(commodity);
		 if(i>0)
		 {//修改成功
			 return true;
		 }
		return false;
	}

	@Override
	public boolean commoditiedel(String id) {
		int i=delDao.commoditiedel(id);
		 if(i>0)
		 {//删除成功
			 return true;
		 }
		return false;
	}

}
